
<%@page import="java.util.GregorianCalendar"%>
<%@page import="java.util.Calendar"%><%@ include file="template/CommonHeader.jsp" %>
<link href="/FMTOOL_WEB/resources/plugins/tables/dataTables/jquery.dataTables.css" type="text/css" rel="stylesheet" />

    <div id="wrapper">
        <%@ include file="template/LeftNavigator.jsp" %>


        <!--Body content-->
        <div id="content" class="clearfix">
            <div class="contentwrapper"><!--Content wrapper-->

                <%@ include file="template/PageHeader.jsp" %>

                <!-- Build page from here: -->
                <%@ include file="template/CommonSuccessMessage.jsp" %>
                <%@ include file="template/CommonErrorMessage.jsp" %>
                
                <div class="row-fluid">
                      
                       
                        <div class="span9">

                            <div class="box gradient">

                                <div class="title">
                                    <h4>
                                        <span>Entry Set Management</span>
                                    </h4>
									
                                </div>
                                <div class="content noPad clearfix" id="entrySetDiv">
                                     
                                  
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span9 -->
                        
                        <div class="span3">

                            <div class="box">

                                <div class="title">

                                    <h4>
                                        <span class="icon16 icomoon-icon-list-view"></span>
                                        <span>Month-Year Selection</span>
                                    </h4>
                                    <a href="#" class="minimize">Minimize</a>
                                </div>
                                <div class="content">
                                    
                                    <select  name="year" id="selectedYear" class="nostyle" style="width:100%;" onchange="fetchEntrySet()">
									    <option value="none">Select a Year</option> 
										<%
									      GregorianCalendar cal = new GregorianCalendar();
									      int currentYear=cal.get(Calendar.YEAR);
									      int startYear=currentYear-2;
									      for(int i=startYear;i<=currentYear+2;i++)
									      {
									    %>
									    <option value="<%=i%>"><%=i%></option>
									    <% } %>
									</select>
									
                                    <select  name="month" id="selectedMonth" class="nostyle" style="width:100%;" onchange="fetchEntrySet()">
										  <option value="none">Select a Month</option>
										<s:iterator value="%{#application.ALL_MONTH}" id="roleList">										  
										  <option value="<s:property value="monthId" />"><s:property value="monthName" /></option>
										</s:iterator>
									</select>
									
									
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span3 -->
                        

                    </div><!-- End .row-fluid -->

                <!-- End page Content: -->
                
            </div>
            <!-- End contentwrapper -->
        </div><!-- End #content -->


    </div><!-- End #wrapper -->
    
 
  

<%@ include file="template/CommonJS.jsp" %>    

 <script type="text/javascript" src="/FMTOOL_WEB/resources/plugins/tables/dataTables/jquery.dataTables.min.js"></script>
 <script type="text/javascript" src="/FMTOOL_WEB/resources/plugins/tables/responsive-tables/responsive-tables.js"></script><!-- Make tables responsive -->
 <script type="text/javascript" src="/FMTOOL_WEB/resources/js/datatable.js"></script><!-- Init plugins only for page -->
 <script type="text/javascript">
  function fetchEntrySet()
  {
   
   var selectedMonth=$("#selectedMonth").val();
   var selectedYear=$("#selectedYear").val();
   
    if(selectedMonth=="none" || selectedYear=="")
     return;
    $("#entrySetDiv").html("<img src='/FMTOOL_WEB/resources/images/loaders/circular/011.gif' border='0' />");
	
	var x= $.ajax({
	 	   url: "entrySetList.action",
	       type: 'POST',
	 	   async: false,
	       data: "month="+selectedMonth+"&year="+selectedYear
	      }).responseText;
				
				      
	$("#entrySetDiv").html(x);
  }
  
    function createEntrySet(makeId,marketId,segmentId,serial)
	  {
	   
	    
	    $("#executeTd"+serial).html("<img src='/FMTOOL_WEB/resources/images/loaders/circular/011.gif' border='0' />");
  		  var x= $.ajax({
 		  		  url: "createEntrySet.action",
  		  type: 'POST',
     		  async: false,
  		  data: "entrySet.makeId=" +makeId+"&entrySet.marketId="+marketId+"&entrySet.segmentId="+segmentId+"&entrySet.year="+$("#selectedYear").val()+"&entrySet.month="+$("#selectedMonth").val()
  		  }).responseText;
					      
		$("#executeTd"+serial).html(x);
		if(x=="Success")
		{ 
		  $("#statusTd"+serial).html("START");
		  $("#checkTd"+serial).html("");
		}
	  }
 </script>
    
		 
<%@ include file="template/CommonFooter.jsp" %>    

